package uqbar.comm;

import java.util.ArrayList;
import java.util.List;

import uqbar.comm.protocol.InputProcessor;


public class CompositeInputProcessor<T> implements InputProcessor<T> {

	private List<InputProcessor<T>> list = new ArrayList<InputProcessor<T>>();

	public boolean add(final InputProcessor<T> e) {
		return this.list.add(e);
	}

	public boolean contains(final InputProcessor<T> o) {
		return this.list.contains(o);
	}

	public boolean remove(final InputProcessor<T> o) {
		return this.list.remove(o);
	}

	@Override
	public void process(final T input) {
		for (InputProcessor<T> inputProcessor : this.list) {
			inputProcessor.process(input);
		}

	}
}
